package bean
{
	import mx.collections.ArrayCollection;

	[RemoteClass(alias="com.bean.Config")]
	[Bindable]
	public class Config
	{
		public static const ROW_NUMBER:String="rowNumber";
		
		public static const PROTOCOL:String="protocol";
		public static const IP_ADDRESS:String="ipAddress";
		public static const MAC_ADDRESS:String="macAddress";
		public static const DUID:String="duid";
		public static const HOST_NAME:String="hostName";
		public static const EVENT:String="event";
		public static const MEMBER_IP_ADDRESS:String="memberIpAddress";
		public static const START_TIME:String="startTime";
		public static const END_TIME:String="endTime";
		public static const LEASE_ISSUE:String="leaseIssue";
		public static const MEMBER_HOST_NAME:String="memberHostName";
		public static const USER_NAME:String="userName";
		
		public var id:Number;
		public var name:String;
		public var value:int;
		
		//flex
		public var isEdit:Boolean=false;

		public static function returnValue(ac:ArrayCollection, name:String):Boolean
		{
			var flag:Boolean=true;
			for each (var config:Config in ac)
			{
				if (config.name == name)
				{
					if (config.value == 0)
					{
						flag=false;
					}
				}
			}
			return flag;
		}

		public static function returnRowNumber(ac:ArrayCollection):int
		{
			var rowNumber:int=15;
			for each (var config:Config in ac)
			{
				if (config.name == ROW_NUMBER)
				{
					rowNumber=config.value;
				}
			}
			return rowNumber;
		}
	}
}